#ifndef __W25Q64_H
#define __W25Q64_H
#include "stm32f1xx_hal.h"
#include "software_spi.h"
#include "W25Q64_Ins.h"

void W25Q64_Init(void);
void W25Q64_ReadID(uint8_t *MID,uint16_t *DID);
void W25Q64_Write_Enable(void);
void W25Q64_WaitBusy(void);
void W25Q64_PageProgram(uint32_t Address,uint8_t *DataArray,uint16_t Count);

void W25Q64_SectorErase(uint32_t Address);
void W25Q64_ReadData(uint32_t Address,uint8_t *DataArray,uint32_t Count);
void W25Q64_WriteData(uint32_t Address, uint8_t *DataArray, uint32_t TotalCount);
void W25Q64_WriteSR_1(uint8_t Data);
uint8_t W25Q64_GetSR_1(void);
void W25Q64_WriteStatus(void);

void W25Q64_BlockErase_32K(uint32_t Address);

void W25Q64_WriteData(uint32_t Address, uint8_t *DataArray, uint32_t TotalCount);

#define W25Q64_SR_WRITE_ENABLE              0x50
#define W25Q64_WRITE_STATUS_REGISTER_1      0x01
#endif
